package com.wgy.day11.类和对象;


class Person {
    private int age;
    String name;

    public void show() {
        System.out.println("我叫" + name + ",年龄" + age);
    }

    ;

    public void setAge(int a) {
        if (a >= 0 && a <= 110) {
            age = a;
        } else {
            System.out.println("数据不合理");
            age = 0;
        }
        ;
    }

    ;

    public int getAge() {
        return age;
    }
}
